def get_short_net_fromCalibre(myfile):
	relist = set()
	with open(myfile, "r") as f:
		for line in f:
			if "SHORT" not in line:
				continue
			parts = line.split("-")
			if len(parts) < 2 :
				print("ERROR!!")
				continue
			
			a = [p.strip() for p in parts[0].split(" ") if p.strip()]
			b = [p.strip() for p in parts[-1].split(" ") if p.strip()]
			relist.add(a[-1])
			relist.add(b[0])

	with open("./short_net.short", "w") as f:
		for i in relist:
			f.write(i+"\n")
	return relist


a = get_short_net_fromCalibre("/projects.SE024/cascade/workspace/xwqiu/PV/LVS/lvs.rep.shorts")
print(a)